﻿using System;

namespace Mono.Cecil
{
	// Token: 0x02000093 RID: 147
	public abstract class MemberReference : IMetadataTokenProvider
	{
		// Token: 0x1700011D RID: 285
		// (get) Token: 0x06000562 RID: 1378 RVA: 0x0001E760 File Offset: 0x0001C960
		// (set) Token: 0x06000563 RID: 1379 RVA: 0x0001E778 File Offset: 0x0001C978
		public virtual string Name
		{
			get
			{
				return this.name;
			}
			set
			{
				bool flag = this.IsWindowsRuntimeProjection && value != this.name;
				if (flag)
				{
					throw new InvalidOperationException();
				}
				this.name = value;
			}
		}

		// Token: 0x1700011E RID: 286
		// (get) Token: 0x06000564 RID: 1380
		public abstract string FullName { get; }

		// Token: 0x1700011F RID: 287
		// (get) Token: 0x06000565 RID: 1381 RVA: 0x0001E7B0 File Offset: 0x0001C9B0
		// (set) Token: 0x06000566 RID: 1382 RVA: 0x00003F6C File Offset: 0x0000216C
		public virtual TypeReference DeclaringType
		{
			get
			{
				return this.declaring_type;
			}
			set
			{
				this.declaring_type = value;
			}
		}

		// Token: 0x17000120 RID: 288
		// (get) Token: 0x06000567 RID: 1383 RVA: 0x0001E7C8 File Offset: 0x0001C9C8
		// (set) Token: 0x06000568 RID: 1384 RVA: 0x00003F76 File Offset: 0x00002176
		public MetadataToken MetadataToken
		{
			get
			{
				return this.token;
			}
			set
			{
				this.token = value;
			}
		}

		// Token: 0x17000121 RID: 289
		// (get) Token: 0x06000569 RID: 1385 RVA: 0x0001E7E0 File Offset: 0x0001C9E0
		public bool IsWindowsRuntimeProjection
		{
			get
			{
				return this.projection != null;
			}
		}

		// Token: 0x17000122 RID: 290
		// (get) Token: 0x0600056A RID: 1386 RVA: 0x0001E7FC File Offset: 0x0001C9FC
		internal bool HasImage
		{
			get
			{
				ModuleDefinition module = this.Module;
				bool flag = module == null;
				return !flag && module.HasImage;
			}
		}

		// Token: 0x17000123 RID: 291
		// (get) Token: 0x0600056B RID: 1387 RVA: 0x0001E828 File Offset: 0x0001CA28
		public virtual ModuleDefinition Module
		{
			get
			{
				return (this.declaring_type != null) ? this.declaring_type.Module : null;
			}
		}

		// Token: 0x17000124 RID: 292
		// (get) Token: 0x0600056C RID: 1388 RVA: 0x00009C40 File Offset: 0x00007E40
		public virtual bool IsDefinition
		{
			get
			{
				return false;
			}
		}

		// Token: 0x17000125 RID: 293
		// (get) Token: 0x0600056D RID: 1389 RVA: 0x0001E850 File Offset: 0x0001CA50
		public virtual bool ContainsGenericParameter
		{
			get
			{
				return this.declaring_type != null && this.declaring_type.ContainsGenericParameter;
			}
		}

		// Token: 0x0600056E RID: 1390 RVA: 0x00002BCC File Offset: 0x00000DCC
		internal MemberReference()
		{
		}

		// Token: 0x0600056F RID: 1391 RVA: 0x00003F80 File Offset: 0x00002180
		internal MemberReference(string name)
		{
			this.name = (name ?? string.Empty);
		}

		// Token: 0x06000570 RID: 1392 RVA: 0x0001E878 File Offset: 0x0001CA78
		internal string MemberFullName()
		{
			bool flag = this.declaring_type == null;
			string result;
			if (flag)
			{
				result = this.name;
			}
			else
			{
				result = this.declaring_type.FullName + "::" + this.name;
			}
			return result;
		}

		// Token: 0x06000571 RID: 1393 RVA: 0x0001E8BC File Offset: 0x0001CABC
		public IMemberDefinition Resolve()
		{
			return this.ResolveDefinition();
		}

		// Token: 0x06000572 RID: 1394
		protected abstract IMemberDefinition ResolveDefinition();

		// Token: 0x06000573 RID: 1395 RVA: 0x0001E8D4 File Offset: 0x0001CAD4
		public override string ToString()
		{
			return this.FullName;
		}

		// Token: 0x0400015D RID: 349
		private string name;

		// Token: 0x0400015E RID: 350
		private TypeReference declaring_type;

		// Token: 0x0400015F RID: 351
		internal MetadataToken token;

		// Token: 0x04000160 RID: 352
		internal object projection;
	}
}
